package com.bc.bczbweb.controller;

import com.bc.bccore.util.PageHelper;
import com.bc.commoncore.util.StringUtils;
import com.bc.commonentity.common.JsonResult;
import com.bc.bcapi.service.T_User_elitesService;
import com.bc.bcmodel.domain.T_User_elitesModel;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.math.BigInteger;

@Controller
@RequestMapping("t_user_elites")
public class T_User_elitesController extends BaseController {
    @Autowired
    T_User_elitesService t_User_elitesService;

    @RequestMapping("list")
    public ModelAndView list() {
        ModelAndView view = super.baseView("列表", "t_user_elites/list");
        return view;
    }

    @RequestMapping("listdo")
    public ModelAndView listdo(T_User_elitesModel req) {
        ModelAndView view = super.baseViewAjax("列表", "t_user_elites/listdo");
        PageInfo<T_User_elitesModel> pageInfo = t_User_elitesService.getList(req);
        view.addObject("data", pageInfo.getList());
        view.addObject("page", PageHelper.GetAjaxHtml(pageInfo, "javascript:loadpage(##);"));
        return view;
    }

    @RequestMapping("add")
    public ModelAndView add(String user_id) {
        String title = "审核";
        ModelAndView view = super.baseView(title, "t_user_elites/add");
        T_User_elitesModel model = new T_User_elitesModel();
        model.setUser_id(user_id);
        T_User_elitesModel data = t_User_elitesService.findByNamedParam(model);
        view.addObject("data", data);
        view.addObject("title", title);
        return view;
    }
}